home *** CD-ROM | disk | FTP | other *** search
- { grdemo.pas -- Demonstrate GraphDLL and GraphLib }
-
- program GrDemo;
-
- uses WinTypes, WinProcs, WObjects, GraphLib;
-
- type
-
- GrDemoApplication = object(TApplication)
- procedure InitMainWindow; virtual;
- end;
-
- PGrDemoWindow = ^GrDemoWindow;
- GrDemoWindow = object(TWindow)
- procedure Paint(PaintDC: HDC; var PaintInfo: TPaintStruct);
- virtual;
- end;
-
-
- { GrDemoApplication }
-
- {- Initialize GrDemoApplication object's window }
- procedure GrDemoApplication.InitMainWindow;
- begin
- MainWindow := New(PGrDemoWindow, Init(nil, 'GrDemo'))
- end;
-
-
- { GrDemoWindow }
-
- {- Paint shapes in window using GraphDLL routines }
- procedure GrDemoWindow.Paint(PaintDC: HDC;
- var PaintInfo: TPaintStruct);
- var
- OldBrush: HBrush;
- OldPen, NewPen: HPen;
- begin
- TWindow.Paint(PaintDC, PaintInfo);
- OldBrush := SelectObject(PaintDC, GetStockObject(hollow_Brush));
- NewPen := CreatePen(ps_Solid, 1, RGB(255, 0, 0));
- OldPen := SelectObject(PaintDC, NewPen);
- Circle(PaintDC, 10, 10, 200);
- Square(PaintDC, 10, 10, 200);
- SelectObject(PaintDC, OldBrush);
- SelectObject(PaintDC, OldPen);
- DeleteObject(NewPen)
- end;
-
- var
-
- GrDemoApp: GrDemoApplication;
-
- begin
- GrDemoApp.Init('GrDemoApp');
- GrDemoApp.Run;
- GrDemoApp.Done
- end.
-
-
- {--------------------------------------------------------------
- Copyright (c) 1991 by Tom Swan. All rights reserved.
- Revision 1.00 Date: 5/25/1991
- ---------------------------------------------------------------}
-